<!DOCTYPE html>
<html>
	<head>
		<title>娱乐系统设置</title>
		@@include('./common/header.html')
	</head>
	<body>
		<div id="app">
		<div class="pub-title">后台管理</div>
		<ul class="pub-tab">
			<li class="option-list">
				<a href="permission_person.html" class="option">管理员</a>
				<a href="permission_group.html" class="option on">权限组</a>
			</li>
			<li class="tab-block-list">
				<ul-form>
					<ui-form-item label="权限组名称" required="true">
						<ui-input></ui-input>
					</ui-form-item>

					<ui-form-item label="权限" required="true">
						<div class="permission-block">
							<div class="permission-block-all">
								<ui-checkbox ref="all" @click="selectall">全选</ui-checkbox>
							</div>
							<div class="permission-list" v-for="(v,k) in permission">
								<ui-checkbox ref="all2" class="permission-block-classify2" @click="selectall2('permission_'+k,k)">{{v.label}}</ui-checkbox>
								<ui-block class="permission-list2" :ref="'permission_'+k">
									<ui-checkbox ref="all3" class="permission-block-classify3"  v-for="(v2,k2) in v.list" :value="v2.value" @click="selectall3('permission_'+k,k2,k)">{{v2.label}}</ui-checkbox>
								</ui-block>
							</div>
						</div>
					</ui-form-item>
					<ui-form-item>
						<ui-btn type="'submit">提交</ui-btn>
					</ui-form-item>
				</ul-form>
			</li>
		</ul>
		</div>
		@@include('./common/footer.html')
	</body>
</html>

<script>
/*
//全选
$('.permission-block .j-all').change(function(){
	var p=$(this).parents('.permission-block');
	p.find('.j-all2,.j-all3').prop('checked',this.checked);
});

//全选二级分类
$('.permission-block .j-all2').change(function(){
	var p=$(this).parents('.permission-list');
	p.find('.j-all3').prop('checked',this.checked);
	var obj=$(this).parents('.permission-block');
	if(obj.find('.j-all2').length==obj.find('.j-all2:checked').length){
		obj.find('.j-all').prop('checked',true);
	}else{
		obj.find('.j-all').prop('checked',false);
	}
});

$('.permission-block .j-all3').change(function(){
	if(this.checked){
		var obj=$(this).parents('.permission-list2');
		if(obj.find('.j-all3').length==obj.find('.j-all3:checked').length){
			$(this).parents('.permission-list').find('.j-all2').prop('checked',true);
			var obj2=$(this).parents('.permission-block');
			if(obj2.find('.j-all2').length==obj2.find('.j-all2:checked').length){
				obj2.find('.j-all').prop('checked',true);
			}
		}
	}else{
		$(this).parents('.permission-list').find('.j-all2').prop('checked',false);
		$(this).parents('.permission-block').find('.j-all').prop('checked',false);
	}
});*/
</script>